package com.gitee.shoes.utils;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author LYH
 */
@Data
@Accessors(chain = true)
public class Result {

    private Integer code;

    private String msg;

    private Object data;

    public static Result ok(Object data) {
        return new Result().setCode(0).setMsg("ok").setData(data);
    }

    public static Result fail(String msg) {
        return new Result().setCode(1).setMsg(msg);
    }
}
